//@ts-check
import { JSDOM } from 'jsdom';

const parse = (/** @type {string} */ str) => {
  const dom = new JSDOM(str);
  const element = dom.window.document.querySelector('div');
  if (element) {
    console.log(`${element.tagName.toLocaleLowerCase()}${Array.from(element.attributes).map(({ name, value }) => (`[${name}="${value}"]`)).join('')}`);
  }
};
parse(`<button type="button" class="Button Button--secondary Button--grey css-ebmf5v">取消</button>`);

